﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BLC
{
    class Program
    {
        static void Main(string[] args)
        {
            Compiler compiler = new Compiler();

            string[] codes = File.ReadAllLines("main.bl");
            for(int i = 0; i < codes.Length; i++)
            {
                codes[i] = compiler.Compile(codes[i]);
            }

            string cscode = File.ReadAllText("model.txt");
            cscode = cscode.Replace("bl-code-bl", string.Join("\n\t\t", codes));

            File.WriteAllText("Program.cs", cscode);

            //Console.ReadKey();
        }
    }
}
